import { UPDATECITY } from './type'
import { Indicator } from 'mint-ui';
export default {
    pushLoadStack(state) {
        Indicator.open({
            text: 'loading...',
            spinnerType: 'snake'
        });
        state.stack.push(1)
    },
    completeLoad(state) {
        let stack = state.stack
        stack.pop()
        if (!stack.length) {
            //延时为了更好显示loading效果
            setTimeout(() => {
                Indicator.close()
            }, 200);
        }
    },
    updateAreaData(state,{area}){
        state.area=area
    },
    [UPDATECITY](state,{city}){
        if(city.name){
            state.name=city.name
            state.data=city.data
            state.rN=city.rN
        }
        state.show=false
    },
    showCityList (state) {
        state.show = true
    },
    pushComingList (state, { lists }) {
        state.lists = lists
    },
    playVideo (state, { audio }) {
        state.url = audio.url 
        state.cover = audio.cover
        state.playStatus = true
    },
    pauseVideo (state) {
        state.playStatus = false
    }
}